package com.rover.entity.system;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.grid.ViewField;

/**
 * 角色.
 *
 */
@Entity
@Table(name = "S_Roles")
public class Role  implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@ViewField
	private Long id;
	@ViewField(header = "角色名称", width = 200)
	private String name;
	@ViewField(header = "描述", width = 300)
	private String description;
	@ViewField
	private Long addById;
	@ViewField
	private String resources;
	@ViewField(header = "超级管理员", width = 300)
	private String sAdmin;

	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(nullable = false, unique = true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	


	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}




	public Long getAddById() {
		return addById;
	}

	public void setAddById(Long addById) {
		this.addById = addById;
	}

	public String getsAdmin() {
		return sAdmin;
	}

	public void setsAdmin(String sAdmin) {
		this.sAdmin = sAdmin;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public void setResources(String resources) {
		this.resources = resources;
	}
	@Transient
	public String getResources() {
		return resources;
	}

}
